package com.homedo.async.mysql.support.convertor.forcolumnval;

import com.homedo.async.mysql.support.dao.TypeChecker;

/**
 * @author jgshun
 * @date 2020/1/20 11:50 AM
 */
public class CompositeConditionColumnValConvertor implements ConditionColumnValConvertorI {

    @Override
    public String convertor(Object columnVal) {
        TypeChecker.TypeEnum typeEnum = TypeChecker.checkType(columnVal.getClass());
        if (typeEnum == TypeChecker.TypeEnum.DATE) {
            return DateConditionColumnValConvertor.getInstance().convertor(columnVal);
        }

        return CommonConditionColumnValConvertor.getInstance().convertor(columnVal);
    }
}
